Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-817

JUnit 4.7 test output is always buffered, lost if forked process exits abnormally

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.11
    • None
    • None

    Description

      The junit47 provider and above support multi-threaded test execution, and thus interpose a buffering layer (ConcurrentReporterManager) in between the test output and the actual stderr/stdout. This is ostensibly to allow the multiple threads' stderr and stdout to be demuxed nicely when the suite completes. But, if the JVM exits abnormally (eg due to a segfault or a System.exit() call), no output is generated. This is problematic since it's very hard to debug the test failure!

      In my opinion, the buffering layer should only be interposed when parallel running is enabled. For the non-parallel case, there's no need to buffer the output. A simple test case is to write a JUnit test which prints a line of output to stderr and then calls System.exit(1). The output doesn't show up anywhere.

      Attachments

        Activity

          People

            tibordigana Tibor Digana
            tlipcon Todd Lipcon
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: